package cate.game.role.res.worldtree.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBWorldTree;

@ClientMsg(title = "世界树加成升级的请求")
@OperationSetter(GDOperation.WORLD_TREE_ADDITION_LEVEL_UP)
public class WorldTreeAdditionLevelUpReq implements MsgInput {
    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getRes().worldTree.addition.levelUp();
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBWorldTree.ADDITION_LEVEL_REQ;
    }
}
